import { StudentInfo } from '@/info/StudentInfo'
import { http } from './index'

// 获取学生列表
export function getStudentList( params={} ) {
  return http.get('/students', { params })
}
// 获取单个学生
export function getStudent(id:number) {
  return http.get(`/students/${id}`)
}

// 添加学生
export function addStudent(data:StudentInfo) {
  return http.post('/students', data)
}

// 更新学生信息
export function updateStudent(id:number, data:StudentInfo) {
  return http.put(`/students/${id}`, data)
}

// 删除学生
export function deleteStudent(id:number) {
  return http.delete(`/students/${id}`)
}
// 添加文件上传方法
export function uploadFile(data:any, studentId:string) {
  return http.post('/students/upload', data, {params: {studentId}});
}
export function uploadFileAudio(data:any, studentId:string) {
  return http.post('/students/uploadFileAudio', data, {params: {studentId}});
}
export function uploadFileVideo(data:any, studentId:string) {
  return http.post('/students/uploadFileVideo', data, {params: {studentId}});
}